package com.sinosoft.dsp.platform.components.portal.iteration;

import com.sinosoft.dsp.platform.utils.MessageBundles;
import com.sinosoft.dsp.platform.utils.SinoManagedBean;

/**
 * 数据表格选择模式类型
 * 
 * @author 潘巍（PeterPan）
 * @since 2011-5-31 下午04:07:05
 * 
 */
public enum DataTableSelectionModeType {
	// 单选
	SINGLE("single", "viewbean.datatable.selectionmode.single"),

	// 多选
	MULTIPLE("multiple", "viewbean.datatable.selectionmode.multi");

	private String value;

	private String text;

	DataTableSelectionModeType(String value, String text) {
		this.value = value;
		this.text = text;
	}

	public static DataTableSelectionModeType getType(String value) {
		for (DataTableSelectionModeType t : DataTableSelectionModeType.values()) {
			if (t.getValue().equals(value)) {
				return t;
			}
		}
		return null;
	}

	public String getValue() {
		return value;
	}

	public String getText() {
		MessageBundles mb = SinoManagedBean.findBean("messageBundles");
		return mb.getValue(text);
	}

}
